package com.project.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.project.bean.EmployeeBean;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;

import java.util.List;


@Mapper
public interface IEmployeeMapper extends BaseMapper<EmployeeBean> {
    @Select("select e.*,d.d_name from t_employee e,t_dept d where d.pk_deptId=e.fk_deptId")
    @ResultMap("emMap")
    public List<EmployeeBean> findAll();
    public IPage<EmployeeBean> cutByItem(
            Page pg,@Param("emName") String emName,
            @Param("deptName") String deptName
    );
}
